package hot100;

import com.链表.练习题.ListNode;

public class g4_环形链表 {
    public boolean hasCycle(ListNode head) {
        ListNode h = head;
        ListNode t = head;
        while (h != null && h.next != null) {
            t = t.next;
            h = h.next.next;
            if(h == t){
                return true;
            }
        }
        return false;

    }
}
